package com.csun.cmny.provider.service;

import com.csun.cmny.provider.model.vo.LifeRoomBuildingVo;
import com.csun.cmny.provider.model.vo.RoomBuildingVo;
import com.csun.cmny.provider.service.hystrix.OmcRoomFeignHystrix;
import com.csun.cmny.security.feign.OAuth2FeignAutoConfiguration;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-04-19 11:56
 * @Description: the interface omc room feign api
 */
@FeignClient(value = "cmny-provider-omc", configuration = OAuth2FeignAutoConfiguration.class, fallback = OmcRoomFeignHystrix.class)
public interface OmcRoomFeignApi {

    @PostMapping(value = "/api/omc/room/queryRoomBuildingByRoomId")
    Wrapper<RoomBuildingVo> queryRoomBuildingByRoomId(@RequestParam("roomId") Integer roomId);

    @PostMapping(value = "/api/omc/room/listRoomByGroupId")
    Wrapper<List<LifeRoomBuildingVo>> listRoomByGroupId(@RequestParam("groupId") Long groupId);

    @PostMapping(value = "/api/omc/room/listBedByRoomId")
    Wrapper<List<Integer>> listBedByRoomId(@RequestParam("roomId") Integer roomId);
}
